package com.un.ebs.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.un.ebs.purchase.domain.*;
import com.un.ebs.purchase.dto.*;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author liubo
 * @since 2020-05-30
 */
public interface PurchaseOrderService {

    String add(PurchaseOrderAddDto req);

    String add(PurchaseOrderAddBySimpleDto req);

    String addByContract(String contractId);

    void addByService(String productionOrderId, String productionOrderItemId, String seqItemId);

    //void addContractByOrder(String entId)

    /**
     * 根据采购订单，预生成采购入库单
     *
     * @param purchaseOrderId
     * @return
     */
    PurchaseInventoryInReadyVo queryInventoryInReady(String purchaseOrderId);

    void update(PurchaseOrderUpdateDto req);

    void save(List<PurchaseOrderUpdateDto> reqs);

    void saveAndSubmit(List<PurchaseOrderUpdateDto> reqs);

    String save(PurchaseOrderUpdateDto req);

    void delete(String id);

    void submit(String id);

    void submitCancel(String id);

    PurchaseOrder queryById(String id);

    PurchaseOrderVo queryViewById(String id);

    /**
     * 按月统计各供应商累计采购入库金额
     * @param year
     * @param month
     * @return
     */
    List<PurchaseMonthSumExt> queryMonthSum(int year,int month);

    IPage<PurchaseOrderItemExt> queryItemView(PurchaseOrderItemQueryDto req);

    IPage<PurchaseOrderExt> query(String searchText, Integer pageSize, Integer pageIndex);

    List<PurchaseOrder> queryByProductionOrder(String id);

    PurchaseOrderItemExt queryItemByProductionItem(String id);

    List<PurchaseOrderItemExt> queryItemByProductionOrder(String productionOrderId);

    IPage<PurchaseOrderItemExt> queryItemById(String id, Integer pageSize, Integer pageIndex);

    IPage<PurchaseOrderDeliverPlanExt> queryDeliverPlan(String searchText, Integer pageSize, Integer pageIndex);

    List<PurchaseOrderDeliverPlanExt> queryDeliverPlanByOrder(String purchaseOrderId);

    IPage<PurchaseSummaryExt> querySummary(String searchText, Integer pageSize, Integer pageIndex);

    IPage<PurchaseSummaryItemExt> querySummaryItem(String id, int pageSize, int pageIndex);

    IPage<PurchaseOrderItemExt> queryItemBySupplier(String id, int pageSize, int pageIndex);

    IPage<PurchaseInNoteToFinance> queryPurchaseInNote(String searchText, int year, int month, int pageSize, int pageIndex);

    IPage<PurchaseInNoteExt> queryPurchaseInNoteBySupplier(String entId, int pageSize, int pageIndex);

    IPage<PurchaseOrderExt> queryNotContractOrder(String entId, int pageSize, int pageIndex);
}
